﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MovieRental.Entities;

namespace MovieRental.BuisnessComponents.Exceptions
{
    public class ItemDuplicateException<TKey> : VerificationException
    {
        public ItemDuplicateException(BaseEntity<TKey> obj, BaseEntity<TKey> duplicate)
            :base(string.Format("The duplicate of {0} was found in the database", obj), null)
        {
            DuplicateObject = duplicate;
        }

        public ItemDuplicateException(TKey id)
            :base("Duplicate of \"{0}\" was found.", null)
        {
        }

        public BaseEntity<TKey> DuplicateObject { private set; get; }
    }
}
